<?php
/**
 * Created by PhpStorm.
 * @User: 王海东
 * @Date: 2018/9/25
 */
namespace app\api\controller;

use app\common\controller\BaseController;
use app\common\model\Config;

class ConfigController extends BaseController
{
    /**
     * 获取网站配置
     * @author 王海东
     * @date
     * @return void
     */
    public function getConfig()
    {
        $in = $this->I([
            [
                "key|配置key",
                null,
                "s",
            ]
        ]);

        $c      = new Config();
        $data   = $c->get($in['key']);

        rjd($data);
    }

    /**
     * 根据配置类型获取配置信息
     * @author 王海东
     * @date
     * @return void
     */
    public function getConfigByType()
    {
        $in = $this->I([
            [
                "type|配置类型",
                null,
                "d",
                "require"
            ]
        ]);

        $c      = new Config();
        $data   = $c->getConfigByType($in['type']);

        rjd($data);
    }
}